<template>
  <div>
    <!-- <img alt="Vue logo" src="./assets/logo.png"> -->
    <Student name="小米" :age="18" sex="男"></Student>
    <school ref="sch"/>
    <h1 v-text="msg" ref="title"></h1>
    <button ref="btn" @click="showDOM">点我提示元素</button>
  </div>
</template>

<script>
import School from './components/School.vue'
import Student from './components/Student.vue'

export default {
  name: 'App',
  components: {
    Student,
    School
  },
  data(){
    return{
      msg:'欢迎您'
    }
  },
  methods:{
    showDOM(){
      console.log(this.$refs.title);//真实DOM元素
      console.log(this.$refs.btn);
      console.log(this.$refs.sch);//school组件的实例对象(VC)
    }
  },
 
}
</script>

